package cn.zlg.common.datadump.condition;

import com.querydsl.core.types.Order;
import com.querydsl.core.types.dsl.ComparableExpression;
import com.querydsl.core.types.dsl.SimpleExpression;
import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class SortFieldDef {
    private SimpleExpression entityProperty;
    private String sortParamName;
    private Order defaultOrder;
    // 是否默认排序，默认排序在无其它筛选条件时有效
    private boolean asDefault;

    public SortFieldDef(SimpleExpression entityProperty, String sortParamName, Order defaultOrder) {
        this.entityProperty = entityProperty;
        this.sortParamName = sortParamName;
        this.defaultOrder = defaultOrder;
    }
}
